package com.apollographql.apollo.api;

import com.apollographql.apollo.api.Operation.Data;
import com.apollographql.apollo.api.Operation.Variables;
import com.apollographql.apollo.api.internal.InputFieldMarshaller;
import com.apollographql.apollo.api.internal.ResponseFieldMapper;
import com.apollographql.apollo.api.internal.ResponseFieldMarshaller;
import com.apollographql.apollo.subscription.ApolloOperationMessageSerializer;
import com.apollographql.apollo.subscription.OperationServerMessage;
import java.io.IOException;
import java.util.Map;
import com.kt.Metadata;
import com.kt.collections.MapsKt;
import com.kt.jvm.internal.DefaultConstructorMarker;
import okio.BufferedSource;
import okio.ByteString;

@Metadata(bv = {1, 0, 3}, d1 = {"\u0000N\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\t\bf\u0018\u0000 \u001f*\b\b\u0000\u0010\u0001*\u00020\u0002*\u0004\b\u0001\u0010\u0003*\b\b\u0002\u0010\u0004*\u00020\u00052\u00020\u0006:\u0003\u001f !J\b\u0010\u0007\u001a\u00020\bH&J\u0010\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\nH&J \u0010\u0007\u001a\u00020\b2\u0006\u0010\u000b\u001a\u00020\f2\u0006\u0010\r\u001a\u00020\f2\u0006\u0010\t\u001a\u00020\nH&J\b\u0010\u000e\u001a\u00020\u000fH&J\b\u0010\u0010\u001a\u00020\u0011H&J\u0016\u0010\u0012\u001a\b\u0012\u0004\u0012\u00028\u00010\u00132\u0006\u0010\u0014\u001a\u00020\u0015H&J\u001e\u0010\u0012\u001a\b\u0012\u0004\u0012\u00028\u00010\u00132\u0006\u0010\u0014\u001a\u00020\u00152\u0006\u0010\t\u001a\u00020\nH&J\u0016\u0010\u0012\u001a\b\u0012\u0004\u0012\u00028\u00010\u00132\u0006\u0010\u0016\u001a\u00020\bH&J\u001e\u0010\u0012\u001a\b\u0012\u0004\u0012\u00028\u00010\u00132\u0006\u0010\u0016\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\nH&J\b\u0010\u0017\u001a\u00020\u0011H&J\u000e\u0010\u0018\u001a\b\u0012\u0004\u0012\u00028\u00000\u0019H&J\r\u0010\u001a\u001a\u00028\u0002H&¢\u0006\u0002\u0010\u001bJ\u0019\u0010\u001c\u001a\u0004\u0018\u00018\u00012\b\u0010\u001d\u001a\u0004\u0018\u00018\u0000H&¢\u0006\u0002\u0010\u001e¨\u0006\""}, d2 = {"Lcom/apollographql/apollo/api/Operation;", "D", "Lcom/apollographql/apollo/api/Operation$Data;", "T", "V", "Lcom/apollographql/apollo/api/Operation$Variables;", "", "composeRequestBody", "Lokio/ByteString;", "scalarTypeAdapters", "Lcom/apollographql/apollo/api/ScalarTypeAdapters;", "autoPersistQueries", "", "withQueryDocument", "name", "Lcom/apollographql/apollo/api/OperationName;", "operationId", "", "parse", "Lcom/apollographql/apollo/api/Response;", "source", "Lokio/BufferedSource;", "byteString", "queryDocument", "responseFieldMapper", "Lcom/apollographql/apollo/api/internal/ResponseFieldMapper;", ApolloOperationMessageSerializer.JSON_KEY_VARIABLES, "()Lcom/apollographql/apollo/api/Operation$Variables;", "wrapData", OperationServerMessage.Data.TYPE, "(Lcom/apollographql/apollo/api/Operation$Data;)Ljava/lang/Object;", "Companion", "Data", "Variables", "apollo-api"}, k = 1, mv = {1, 4, 0})
/* compiled from: Operation.kt */
public interface Operation<D extends Data, T, V extends Variables> {
    public static final Companion Companion = new Companion(null);
    public static final Variables EMPTY_VARIABLES = new Variables();

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\bf\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H&¨\u0006\u0004"}, d2 = {"Lcom/apollographql/apollo/api/Operation$Data;", "", "marshaller", "Lcom/apollographql/apollo/api/internal/ResponseFieldMarshaller;", "apollo-api"}, k = 1, mv = {1, 4, 0})
    /* compiled from: Operation.kt */
    public interface Data {
        ResponseFieldMarshaller marshaller();
    }

    ByteString composeRequestBody();

    ByteString composeRequestBody(ScalarTypeAdapters scalarTypeAdapters);

    ByteString composeRequestBody(boolean z, boolean z2, ScalarTypeAdapters scalarTypeAdapters);

    OperationName name();

    String operationId();

    Response<T> parse(BufferedSource bufferedSource) throws IOException;

    Response<T> parse(BufferedSource bufferedSource, ScalarTypeAdapters scalarTypeAdapters) throws IOException;

    Response<T> parse(ByteString byteString) throws IOException;

    Response<T> parse(ByteString byteString, ScalarTypeAdapters scalarTypeAdapters) throws IOException;

    String queryDocument();

    ResponseFieldMapper<D> responseFieldMapper();

    V variables();

    T wrapData(D d);

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010$\n\u0000\b\u0016\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0006\u0010\u0003\u001a\u00020\u0004J\u000e\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006J\b\u0010\u0007\u001a\u00020\bH\u0016J\u0016\u0010\t\u001a\u0010\u0012\u0004\u0012\u00020\u0004\u0012\u0006\u0012\u0004\u0018\u00010\u00010\nH\u0016¨\u0006\u000b"}, d2 = {"Lcom/apollographql/apollo/api/Operation$Variables;", "", "()V", "marshal", "", "scalarTypeAdapters", "Lcom/apollographql/apollo/api/ScalarTypeAdapters;", "marshaller", "Lcom/apollographql/apollo/api/internal/InputFieldMarshaller;", "valueMap", "", "apollo-api"}, k = 1, mv = {1, 4, 0})
    /* compiled from: Operation.kt */
    public static class Variables {
        public Map<String, Object> valueMap() {
            return MapsKt.emptyMap();
        }

        public InputFieldMarshaller marshaller() {
            return new Operation$Variables$marshaller$1();
        }

        public final String marshal() throws IOException {
            return marshal(ScalarTypeAdapters.DEFAULT);
        }

        /* JADX WARNING: Code restructure failed: missing block: B:11:0x0052, code lost:
            r0 = move-exception;
         */
        /* JADX WARNING: Code restructure failed: missing block: B:12:0x0054, code lost:
            if (r3 != null) goto L_0x0058;
         */
        /* JADX WARNING: Code restructure failed: missing block: B:14:?, code lost:
            r3.close();
         */
        /* JADX WARNING: Code restructure failed: missing block: B:16:0x005e, code lost:
            throw r0;
         */
        /* Code decompiled incorrectly, please refer to instructions dump. */
        public final String marshal(ScalarTypeAdapters r11) throws IOException {
            /*
                r10 = this;
                java.lang.String r0 = "scalarTypeAdapters"
                com.kt.jvm.internal.Intrinsics.checkParameterIsNotNull(r11, r0)
                okio.Buffer r0 = new okio.Buffer
                r0.<init>()
                r1 = r0
                r2 = 0
                com.apollographql.apollo.api.internal.json.JsonWriter$Companion r3 = com.apollographql.apollo.api.internal.json.JsonWriter.Companion
                r4 = r1
                okio.BufferedSink r4 = (okio.BufferedSink) r4
                com.apollographql.apollo.api.internal.json.JsonWriter r3 = r3.of(r4)
                java.io.Closeable r3 = (java.io.Closeable) r3
                r4 = 0
                r5 = 0
                java.lang.Throwable r5 = (java.lang.Throwable) r5
                r6 = r3
                com.apollographql.apollo.api.internal.json.JsonWriter r6 = (com.apollographql.apollo.api.internal.json.JsonWriter) r6     // Catch:{ all -> 0x004e }
                r7 = 0
                r8 = 1
                r6.setSerializeNulls(r8)     // Catch:{ all -> 0x004e }
                r6.beginObject()     // Catch:{ all -> 0x004e }
                com.apollographql.apollo.api.internal.InputFieldMarshaller r8 = r10.marshaller()     // Catch:{ all -> 0x004e }
                com.apollographql.apollo.api.internal.json.InputFieldJsonWriter r9 = new com.apollographql.apollo.api.internal.json.InputFieldJsonWriter     // Catch:{ all -> 0x004e }
                r9.<init>(r6, r11)     // Catch:{ all -> 0x004e }
                com.apollographql.apollo.api.internal.InputFieldWriter r9 = (com.apollographql.apollo.api.internal.InputFieldWriter) r9     // Catch:{ all -> 0x004e }
                r8.marshal(r9)     // Catch:{ all -> 0x004e }
                r6.endObject()     // Catch:{ all -> 0x004e }
                com.kt.Unit r6 = com.kt.Unit.INSTANCE     // Catch:{ all -> 0x004e }
                if (r3 != 0) goto L_0x0041
                goto L_0x0044
            L_0x0041:
                r3.close()
            L_0x0044:
                java.lang.String r0 = r0.readUtf8()
                return r0
            L_0x004e:
                r0 = move-exception
                r5 = r0
                throw r0     // Catch:{ all -> 0x0052 }
            L_0x0052:
                r0 = move-exception
                if (r3 == 0) goto L_0x005d
                r3.close()     // Catch:{ all -> 0x005c }
                goto L_0x005d
            L_0x005c:
                r6 = move-exception
            L_0x005d:
                throw r0
            */
            throw new UnsupportedOperationException("Method not decompiled: com.apollographql.apollo.api.Operation.Variables.marshal(com.apollographql.apollo.api.ScalarTypeAdapters):java.lang.String");
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\b\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u0016\u0010\u0003\u001a\u00020\u00048\u0006X\u0004ø\u0001\u0000¢\u0006\u0002\n\u0000¨\u0006\u0001\u0002\u0007\n\u0005\bF0\u0001¨\u0006\u0005"}, d2 = {"Lcom/apollographql/apollo/api/Operation$Companion;", "", "()V", "EMPTY_VARIABLES", "Lcom/apollographql/apollo/api/Operation$Variables;", "apollo-api"}, k = 1, mv = {1, 4, 0})
    /* compiled from: Operation.kt */
    public static final class Companion {
        static final /* synthetic */ Companion $$INSTANCE = null;

        private Companion() {
        }

        public /* synthetic */ Companion(DefaultConstructorMarker $constructor_marker) {
            this();
        }
    }
}
